<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link rel="stylesheet" href="../../libs/css/index.css" />
		<script src="../../libs/js/vue.min.js"></script>
		<script src="../../libs/js/vant.min.js"></script>
		<link rel="stylesheet" type="text/css" href="../../libs/css/personal.css" />
		<script src="html5plus://ready"></script>
	</head>
	<body>
		<div id="app">
			<header>
				<div>
					<img src="../../libs/img/timg.jpg" id="img" @click="login" />
					<div id="wdl" style="color: white;" @click="login">{{user}}</div>
					<div style="clear: both;"></div>
				</div>
			</header>
			<section>
				<div id="sec">
					<van-col span="6" class="icon">
						<van-icon name="pending-payment" size="20px"></van-icon>
						<div @click="daifukuan">
							待付款
						</div>
					</van-col>
					<van-col span="6" class="icon">
						<van-icon name="records" size="20px"></van-icon>
						<div @click="daishouhuo">
							待收货
						</div>
					</van-col>
					<van-col span="6" class="icon">
						<van-icon name="tosend" size="20px"></van-icon>
						<div @click="daipinglun">
							待评论
						</div>
					</van-col>
					<van-col span="6" class="icon">
						<van-icon name="logistics" size="20px"></van-icon>
						<div @click="mydingdan">
							我的订单
						</div>
					</van-col>
				</div>
				<div>
					<van-row>
						<van-col span="24">
							<van-cell title="个人资料" icon="manager-o" is-link @click="myziliao"/>
						</van-col>
						<van-col span="24">
							<van-cell title="收货地址" icon="location-o" is-link @click="mydizhi" />
						</van-col>
						<van-col span="24">
							<van-cell title="我的收藏" icon="like-o" is-link @click="myshoucang" />
						</van-col>
						<van-col span="24" style="margin-top: 15px;">
							<van-cell title="设置" icon="setting-o" is-link @click="OpenSetting" />
						</van-col>
					</van-row>
				</div>
			</section>
		</div>
		<script>
			var vm = new Vue({
				el: "#app",
				data: {
					user: '未登录'
				},
				mounted: function() {
					if (plus.storage.getItem("key") != null) {
						console.log(this.user = plus.storage.getItem("name"));
						this.user = plus.storage.getItem("name");
					} else {
						this.user = "未登录";
					}
				},
				methods: {
					OpenSetting: function() {
						plus.webview.create("Setting.html", "setting");
						plus.webview.show("setting", "slide-in-right");
					},
					login: function() {
						if (this.user == "未登录") {
							plus.webview.create("login.html", "login");
							plus.webview.show("login", "slide-in-right");
						}
					},
					daifukuan: function(){
						plus.webview.open("Pending.html","daifukuan");
						plus.webview.close();
					},
					daishouhuo: function(){
						plus.webview.open("Uncollected.html","daishouhuo");
					},
					daipinglun: function(){
						plus.webview.open("comment.html","daipinglun");
					},
					mydingdan: function(){
						plus.webview.open("Order.html","mydingdan");
					},
					myziliao: function(){
						plus.webview.open("data.html","myziliao");
					},
					mydizhi: function(){
						plus.webview.open("address.html","mydizhi");
					},
					myshoucang: function(){
						plus.webview.open("Collection.html","myshoucang");
					}
				}
			});
		</script>
	</body>
</html>